function dfs(node) {
    let result = [];
    if (node) {
        result.push(node);
        let children = node.children;
        for (let i = 0; i < children.length; i++) {
            dfs(children[i])

        }
    }
    return result
}


function bfs(node) {
    let result = [];
    while (node.length) { // 注意
        let item = node.shift();
        result.push(item)
        let children = item.children;
        for (let i = 0; i < children.length; i++) {
            node.push(children.length)
        }
    }
    return result;
}